package com.lanp.gencode.utils;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

public class SigoListUtils {

    public static List<String> toList(String... strs) {
        List<String> strings = new ArrayList<>();
        for (String str : strs) {
            strings.add(str);
        }
        return strings;
    }

    public static List<String> iteratToList(BigDecimal max, BigDecimal min, BigDecimal add) {
        List<String> ress = new ArrayList<>();
        BigDecimal addBig = max.add(min.abs());
        int iCount = addBig.divide(add).intValue();
        ress.add(min.toString());
        for (int i = 0; i <= iCount; i++) {
            min = min.add(add);
            ress.add(min.toString());
        }
        if (min.compareTo(max) < 0) {
            ress.add(max.toString());
        }
        return ress;
    }
}
